package mysql

import "gorm.io/gorm"

type Good struct {
	gorm.Model
	GoodId int    `gorm:"type:int(11);not null;index:ip_idx"`
	Price  int    `gorm:"type:int(11);not null;"`
	Stock  int    `gorm:"type:int(11);not null;"`
	Title  string `gorm:"type:varchar(42);not null;"`
	Status string `gorm:"type:varchar(42);not null;"`
}

func (G *Good) GoodFind(GoodId int) error {
	return DB.Debug().Where("good_id", GoodId).Find(&G).Error
}
